package com.ccl.iot.db;

import android.database.sqlite.SQLiteDatabase;

public class SqlDao {

	public void createTabel(SQLiteDatabase db, String sqlCmd){
		//create table reglog (_id integer primary key autoincrement, refid integer, logid integer, logtime text)
		db.execSQL(sqlCmd);
	}
	
	public void insert(SQLiteDatabase db, long refID, long logID, String timelog){
		db.execSQL("insert into reglog(refid, logid, logtime) values("+refID+", "+logID+", '"+timelog+"')");
	}
	
	public void delete(SQLiteDatabase db, int refid){
		db.execSQL("delete from reglog where refid = "+refid);
	}
	
	public void update(SQLiteDatabase db, int id, String timelog){
		db.execSQL("update reglog set logtime = '"+timelog+"' where _id = "+id);
	}
	
}
